<template>
	<view class="page_body">
		<!-- 状态栏高度 设置背景色 占位状态栏-->
		<view class="ztl" :style="{'height':statusBarHeight}"></view>
		<!-- 占位盒子 -->
		<view class="" :style="{'height': height}"></view>
		<!-- 导航栏 -->
		<navBar bgColor="#FFF">
			<image :slot="'left'" @click="navToBack" :src="xcxImgUrl && xcxImgUrl+'fanhui.svg'" style="width: 36rpx;height: 36rpx;">
			</image>
			<text :slot="'content'">订单详情</text>
		</navBar>

		<scroll-view scroll-y :style="{'height': 'calc(100vh  - ' + demoTopHieght +')'}"
			class="mian_orferDetails pd_lr10">
			<view class="mian_orfer_top mt10 pd10">
				<view class="mian_orfer_top_t">
					<view class="mian_orfer_top_t_l mr10">
						<image v-if="[1].includes(commonityItem.payStatus) && ![5,6,7,8].includes(commonityItem.status)"
							:src="xcxImgUrl && xcxImgUrl+'page_public/static/orderDetails_daishoukuan.svg'"></image>
						<image v-else-if="commonityItem.status == 3" :src="xcxImgUrl && xcxImgUrl+'page_public/static/orderDetails_daifahuo.svg'"></image>
						<image v-else-if="commonityItem.status == 4" :src="xcxImgUrl && xcxImgUrl+'page_public/static/orderDetails_daishouhuo.svg'"></image>
						<image v-else-if="commonityItem.status == 5" :src="xcxImgUrl && xcxImgUrl+'page_public/static/orderDetails_yiwancheng.svg'"></image>
						<image v-else-if="commonityItem.status == 6 || commonityItem.status == 7"
							:src="xcxImgUrl && xcxImgUrl+'page_public/static/orderDetails_yiquxiao.svg'"></image>
						<image v-else-if="commonityItem.status == 1" :src="xcxImgUrl && xcxImgUrl+'page_public/static/orderDetails_daishenhe.svg'"></image>
						<image v-else-if="commonityItem.status == 2" :src="xcxImgUrl && xcxImgUrl+'page_public/static/orderDetails_daiqueren.svg'"></image>
						<image v-else :src="xcxImgUrl && xcxImgUrl+'page_public/static/orderDetails_daishoukuan.svg'"></image>
					</view>

					<!-- 待付款 -->
					<view v-if="[1].includes(commonityItem.payStatus) && ![2,5,6,7,8].includes(commonityItem.status)  "
						class="mian_orfer_top_t_r">
						<view class="mian_orfer_top_t_r_t">
							待付款
						</view>
						<view class="mian_orfer_top_t_r_b" v-if="computedPayDate != '不限制'" style="display: flex;align-items: center">
							剩余支付时间：<u-count-down v-if="computedPayDate != '不限制'" :time="computedPayDate" format="HH:mm:ss"></u-count-down>
						</view>
					</view>

					<!-- 代发货 -->
					<view v-else-if="[3].includes(commonityItem.status) " class="mian_orfer_top_t_r">
						<view class="mian_orfer_top_t_r_t">
							待发货
						</view>
						<view class="mian_orfer_top_t_r_b">
							您的商品已经在路上了~
						</view>
					</view>

					<!-- 待收货 -->
					<view v-else-if="[4].includes(commonityItem.status) " class="mian_orfer_top_t_r">
						<view class="mian_orfer_top_t_r_t">
							待收货
						</view>
						<view class="mian_orfer_top_t_r_b">
							感谢您光顾,请早点签收哦~
						</view>
					</view>

					<!-- 已完成 -->
					<view v-else-if="[5].includes(commonityItem.status) " class="mian_orfer_top_t_r">
						<view class="mian_orfer_top_t_r_t">
							已完成
						</view>
						<view class="mian_orfer_top_t_r_b">
							该订单已完成了~
						</view>
					</view>

					<!-- 待审核 -->
					<view v-else-if="[1].includes(commonityItem.status) " class="mian_orfer_top_t_r">
						<view class="mian_orfer_top_t_r_t">
							待审核
						</view>
						<view class="mian_orfer_top_t_r_b">
							您的订单已提交,等待审核~
						</view>
					</view>

					<!-- 已取消 -->
					<view v-else-if="[7].includes(commonityItem.status) " class="mian_orfer_top_t_r">
						<view class="mian_orfer_top_t_r_t">
							已关闭
						</view>
						<view class="mian_orfer_top_t_r_b">
							该订单已被取消了~
						</view>
					</view>

					<view v-else-if="[6].includes(commonityItem.status) " class="mian_orfer_top_t_r">
						<view class="mian_orfer_top_t_r_t">
							已作废
						</view>
						<view class="mian_orfer_top_t_r_b">
							该订单已被作废了~
						</view>
					</view>

					<!-- 待确认 -->
					<view v-else-if="[2].includes(commonityItem.status) " class="mian_orfer_top_t_r">
						<view class="mian_orfer_top_t_r_t">
							待确认
						</view>
						<view class="mian_orfer_top_t_r_b">
							请确认修改后的订单~
						</view>
					</view>

					<!-- 待付款 -->
					<!-- <view v-else class="mian_orfer_top_t_r">
						<view class="mian_orfer_top_t_r_t">
							待付款
						</view>
						<view class="mian_orfer_top_t_r_b">
							剩余支付时间：12:12:12
						</view>
					</view> -->

				</view>
				<view class="mian_orfer_top_b">
					<view class="mian_orfer_top_b_t mt10">
						<image style="width: 36rpx;height: 36rpx;margin-right: 20rpx;" src="@/static/newpic/cartAddress.svg">
						</image>
						<text class="name mr10">{{commonityItem.recipient ? commonityItem.recipient : ''}}</text>
						<text class="phone">{{commonityItem.phone ? commonityItem.phone : 0}}</text>
					</view>
					<view class="mian_orfer_top_b_b texttowShow mt10">
						{{cpmputedAddress}}
					</view>
				</view>
			</view>

			<!-- 商品信息 -->
			<view class="mian_allOrder_list_item mb10 mt10">
				<view class="list_item_top pd_lr10">
					<view class="list_item_top_left">
						商品清单
					</view>

					<view class="list_item_top_right">
						共:{{commonityItem.qty ? commonityItem.qty : 0}}件
					</view>
				</view>
				<!-- 商品信息 -->
				<view v-for="(it,inx) in commonityItem.commodityInfo" :key="inx" class="list_item_conter pd10">
					<navigator
					         
					          :url="`/page_public/commodityDetail?commodityId=${it.commodityId}`"
					          hover-class="none"
					        >
					<view class="list_item_conter_top">
						<view class="list_item_conter_top_img" v-if="updateNoneImg">
							<image
								:src=" it.spuInfo && it.spuInfo.picture ? uploadImgUrl + it.spuInfo.picture : computedMorentu">
							</image>
						</view>
						<view class="list_item_conter_top_text ml5">
							<view class="list_item_conter_top_text_top texttowShow">
								{{it.spuInfo && it.spuInfo.name ? it.spuInfo.name : ''}}
							</view>
							<template v-if="commonityItem.type == 1">
								<view v-for="(itCd,inxCd) in it.children" :key="inxCd"
									class="list_item_conter_top_text_bom ">
									<view class="list_item_conter_top_text_bom_item mt10">
										<text class="list_item_conter_top_text_bom_item_l">
											{{
											itCd.skuInfo &&
											itCd.skuInfo.unitInfo && 
											itCd.skuInfo.unitInfo.name &&
											itCd.skuInfo.specsOptionInfo && 
											itCd.skuInfo.specsOptionInfo.length ? 
											itCd.skuInfo.specsOptionInfo.map(it=>it.optionName).join(' ') +
											'/' +
											itCd.skuInfo.unitInfo.name :
											itCd.skuInfo.unitInfo.name
											
										}}
										</text>
										<text class="list_item_conter_top_text_bom_item_r">
											￥{{itCd.price ? Utils.formatToFixed(itCd.price,'price') : 0}}X{{itCd.qty ? itCd.qty : 0}}
										</text>
									</view>
								</view>
							</template>
							<template v-if="commonityItem.type == 2">
								<view class="list_item_conter_top_text_bom ">
									<view class="list_item_conter_top_text_bom_item mt10">
										<text class="list_item_conter_top_text_bom_item_l">
											{{
											it.skuInfo &&
											it.skuInfo.unitInfo && 
											it.skuInfo.unitInfo.name &&
											it.skuInfo.specsOptionInfo && 
											it.skuInfo.specsOptionInfo.length ? 
											it.skuInfo.specsOptionInfo.map(it=>it.optionName).join(' ') +
											'/' +
											it.skuInfo.unitInfo.name :
											it.skuInfo.unitInfo.name
											
										}}
										</text>
										<text class="list_item_conter_top_text_bom_item_r">
											￥{{it.price ? Utils.formatToFixed(it.price,'price') : 0}}X{{it.qty ? it.qty : 0}}
										</text>
									</view>
									<!-- 满减 -->
									<view v-if="commonityItem.type == 2 && commonityItem.activityType == 2"
										class="biaoqian mt10">
										优惠:{{it.preferential ? Utils.formatToFixed(it.preferential,'money') : 0}}元
									</view>
								</view>
							</template>
						</view>
					</view>
					</navigator>
					<!-- 活动赠品信息 //订单类型[1：普通订单 2：促销订单] -->
					<template
						v-if="commonityItem.type == 2 && commonityItem.activityType == 1 && it.children &&  it.children.length" >
						<view  class="list_item_conter_bom mt10"  v-for="(itc,inxc) in it.children"
							:key="item.commodityId">
							  <navigator
							            style="display: flex; margin-left: 119rpx;"
							           
							            :url="`/page_public/commodityDetail?commodityId=${itc.commodityId}`"
							            hover-class="none"
							          >
							<view class="list_item_conter_top_img" v-if="updateNoneImg">
								<image class="zenpin" :src="xcxImgUrl && xcxImgUrl+'page_public/static/zengpin.svg'"></image>
								<image
									:src=" itc.spuInfo && itc.spuInfo.picture ? uploadImgUrl + itc.spuInfo.picture : computedMorentu">
								</image>
							</view>
							<view class="list_item_conter_top_text ml5">
								<view class="list_item_conter_top_text_top texttowShow">
									{{itc.spuInfo && itc.spuInfo.name ? itc.spuInfo.name : 0}}
								</view>
								<view class="list_item_conter_top_text_bom ">
									<view class="list_item_conter_top_text_bom_item mt10">
										<text class="list_item_conter_top_text_bom_item_l">
											{{
												itc.skuInfo &&
												itc.skuInfo.unitInfo && 
												itc.skuInfo.unitInfo.name &&
												itc.skuInfo.specsOptionInfo && 
												itc.skuInfo.specsOptionInfo.length ? 
												itc.skuInfo.specsOptionInfo.map(it=>it.optionName).join(' ') +
												'/' +
												itc.skuInfo.unitInfo.name :
												itc.skuInfo.unitInfo.name
												
											}}
										</text>
										<text class="list_item_conter_top_text_bom_item_r">
											X{{itc.qty ? itc.qty : 0}}</text>
									</view>
								</view>
							</view>
						</navigator>
						</view>
					</template>
				</view>

			</view>

			<!-- 订单详情 -->
			<view class="mian_confirmOrder_detail mt10">
				<view class="mian_confirmOrder_detail_t pd_lr10">
					<view class="mian_confirmOrder_detail_t_l">
						订单详情
					</view>
				</view>
				<view class="mian_confirmOrder_detail_b pd_lr10">
					<view class="mian_confirmOrder_detail_b_r">
						<view class="mian_confirmOrder_detail_b_r_l">
							订单总金额
						</view>
						<view class="mian_confirmOrder_detail_b_r_r">
							{{Utils.formatToFixed(commonityItem.money ? commonityItem.money : 0,'money')}}元
						</view>
					</view>
					<view class="mian_confirmOrder_detail_b_r">
						<view class="mian_confirmOrder_detail_b_r_l">
							优惠金额
						</view>
						<view class="mian_confirmOrder_detail_b_r_r">
							{{Utils.formatToFixed(commonityItem.preferential ? commonityItem.preferential : 0, 'money')}}元
						</view>
					</view>
					<view class="mian_confirmOrder_detail_b_r">
						<view class="mian_confirmOrder_detail_b_r_l">
							应付金额
						</view>
						<view class="mian_confirmOrder_detail_b_r_r">
							{{Utils.formatToFixed(commonityItem.preferential ? commonityItem.money - commonityItem.preferential : commonityItem.money,'money')}}元
						</view>
					</view>
					<view class="mian_confirmOrder_detail_b_r"
						style="height:auto;align-items:flex-start;padding:20rpx 0;box-sizing: border-box;">
						<view class="mian_confirmOrder_detail_b_r_l">
							备注信息
						</view>
						<!-- <view class="mian_confirmOrder_detail_b_r_r"> -->
							<u-textarea confirmType="done"
						height='100'
						border='none'
						v-model="commonityItem.summary"></u-textarea> 
						<!-- 	{{commonityItem.summary ? commonityItem.summary : ''}} -->
						<!-- </view> -->

					</view>
				</view>
			</view>

			<!-- 订单日期 -->
			<view class="mian_confirmOrder_detail mt10">
				<view class="mian_confirmOrder_detail_b pd_lr10">
					<view class="mian_confirmOrder_detail_b_r">
						<view class="mian_confirmOrder_detail_b_r_l">
							订单编号
						</view>
						<view class="mian_confirmOrder_detail_b_r_r">
							{{commonityItem.number ? commonityItem.number : ''}}
						</view>
						<view
							style="border: 1px solid #f3f3f3;border-radius: 10rpx;padding: 6rpx 10rpx;font-size: 28rpx;"
							@click="copyText(commonityItem.number)" class="">
							复制
						</view>
					</view>
					<view class="mian_confirmOrder_detail_b_r">
						<view class="mian_confirmOrder_detail_b_r_l">
							下单时间
						</view>
						<view class="mian_confirmOrder_detail_b_r_r">
							{{commonityItem.createTime ? Utils.DateFormateArr(commonityItem.createTime) : ''}}
						</view>
					</view>
					<view class="mian_confirmOrder_detail_b_r">
						<view class="mian_confirmOrder_detail_b_r_l">
							付款时间
						</view>
						<view class="mian_confirmOrder_detail_b_r_r">
							{{commonityItem.payTime ? Utils.DateFormateArr(commonityItem.payTime) : ''}}
						</view>
					</view>
					<view class="mian_confirmOrder_detail_b_r">
						<view class="mian_confirmOrder_detail_b_r_l">
							发货时间
						</view>
						<view class="mian_confirmOrder_detail_b_r_r">
							{{commonityItem.deliveryTime ? Utils.DateFormateArr(commonityItem.deliveryTime) : ''}}
						</view>
					</view>
					<view class="mian_confirmOrder_detail_b_r">
						<view class="mian_confirmOrder_detail_b_r_l">
							收货时间
						</view>
						<view class="mian_confirmOrder_detail_b_r_r">
							{{commonityItem.endTime ? Utils.DateFormateArr(commonityItem.endTime) : ''}}
						</view>
					</view>
				</view>
			</view>

		</scroll-view>

		<view class="mian_orderDetailsBom pd_lr10">
			<view v-if="(commonityItem.payStatus == 1   && (commonityItem.status == 3 || commonityItem.status == 1) && (current == 1 || current == 0))"
				@click.stop="closeOrder(commonityItem)" class="list_item_btn_item ml5">
				关闭订单
			</view>

			<view @click.stop="lijiZhifu(commonityItem)"
				v-if="(commonityItem.payStatus == 1 && (commonityItem.status == 3 || commonityItem.status == 1) && (current == 1 || current == 0))"
				class="list_item_btn_item list_item_btn_item_active ml5">
				立即支付
			</view>
			<view v-if="commonityItem.status == 2" @click.stop="sureOrder(commonityItem)"
				class="list_item_btn_item ml5 list_item_btn_item_active">
				确认订单
			</view>
			<view @click.stop="sureShouhuo(commonityItem)" v-if="commonityItem.status == 4"
				class="list_item_btn_item list_item_btn_item_active ml5">
				确认收货
			</view>
			<view @click.stop="applyService"
				v-if="[4,5].includes(commonityItem.status) || ([1,3].includes(commonityItem.status) && [3].includes(commonityItem.payStatus)) "
				class="list_item_btn_item ml5">
				申请售后
			</view>
			<view @click.stop="delOrder(commonityItem)"
				v-if="commonityItem.status == 5 || commonityItem.status == 7  || commonityItem.status == 6"
				class="list_item_btn_item ml5">
				删除订单
			</view>
		</view>

		<!-- 模态框确认 -->
		<u-modal :show="modalShow" :title="modalInfo.title" showConfirmButton showCancelButton @confirm='modalConfirm'
			@cancel='modalShow = false' :content='modalInfo.content'>

		</u-modal>
	</view>
</template>

<script>
	import {
		mapGetters
	} from 'vuex'
	import {
		uploadImgUrl
	} from '@/utils/request.js'
	import {
		updateMallOrderStatus,
		deleteMallOrderByOrderId
	} from '@/api/global.js'
	export default {
		computed: {
			...mapGetters(['demoTopHieght']),
			//返回默认图
			computedMorentu() {
				return this.$store.state.morentu
			},
			//返回有图无图控制
			updateNoneImg() {
				return this.$store.state.configSetting.noneImge == 1 ? false : true
			},
			//返回地址
			cpmputedAddress() {
				let province = this.commonityItem?.province || ''
				let city = this.commonityItem?.city || ''
				let area = this.commonityItem?.area || ''
				let address = this.commonityItem?.address || ''
				return province + city + area + address
			},
			//返回订单支付倒计时开始时间
			computedPayDate() {
				let youxiaoshichang = ''
				// 根据设置获取有效时长
				if (this.$store?.state?.configSetting?.payDate == 0) { //不限制
					return '不限制'
				} else if (this.$store?.state?.configSetting?.payDate == 1) { //5分钟
					youxiaoshichang = 5
				} else if (this.$store?.state?.configSetting?.payDate == 2) { //10分钟
					youxiaoshichang = 10
				} else if (this.$store?.state?.configSetting?.payDate == 3) { //30分钟
					youxiaoshichang = 30
				} else if (this.$store?.state?.configSetting?.payDate == 4) { //两小时
					youxiaoshichang = 2 * 60
				} else if (this.$store?.state?.configSetting?.payDate == 5) { //12小时
					youxiaoshichang = 12 * 60
				} else if (this.$store?.state?.configSetting?.payDate == 6) { //24小时
					youxiaoshichang = 24 * 60
				}
				console.log(youxiaoshichang);
				//获取创建时间 时间戳
				let createTime = new Date(this.Utils.DateFormateArr(this.commonityItem.createTime)).getTime()
				console.log(createTime);
				//获取当前时间的时间戳
				let nowTime = new Date().getTime()
				console.log(nowTime);
				//获取创建时间到当前时间的时间差
				let countSecond = parseInt((nowTime - createTime))
				console.log(countSecond);
				//有效时间减去时间差 得到剩余倒计时时间
				let times = youxiaoshichang * 60 * 1000 - countSecond
				console.log(times);
				return times


			}
		},
		data() {
			return {
				uploadImgUrl,
				statusBarHeight: '',
				height: '',
				commonityItem: {}, //商品信息
				routeType: '', //接受从那个页面过来
				current: '', //1.待付款 3.代发货
				modalShow: false, //模态框
				modalInfo: { //模态框提示对象内容
					title: '温馨提示',
					content: ''
				},
				modalType: 0, //区分模态确认后点击事件
				orderId: '', //订单id
			};
		},
		onLoad(options) {
			//接受那个页面的信息
			this.routeType = options?.routeType || ''
			this.current = options?.current || ''
			//读取商品信息
			this.commonityItem = this.$store?.state?.commonityItem
			console.log(this.commonityItem,'this.commonityItem');
		},
		onShow() {
			this.$nextTick(() => {
				// 获取状态栏的高度
				this.statusBarHeight = this.$store.state.statusBarHeight * 2 + 'rpx'
				// 计算站位的高度
				this.height = (this.$store.state.navBarHeight) * 2 + 'rpx'
				//获取高度
				this.Utils.getDemoTopHeight('mian_orferDetails')
			})
		},
		methods: {
			toDetails(item){
				uni.navigateTo({
					url:`/page_public/commodityDetail?commodityId=${item.commodityId}`
				})
			},
			//跳转申请售后
			applyService() {
				uni.navigateTo({
					url: '/page_public/applyService'
				})
			},
			//立即支付
			lijiZhifu(item) {
				//2.普通 1.促销
				let type = item.type == 1 ? 2 : 1
				// uni.navigateTo({
				// 	url: `/page_public/surePay?type=${type}&yinfuMoney=${item.money - item.preferential}&time=${this.Utils.DateFormateArr(item.createTime)}&orderId=${item.orderId}`
				// })
				if(getCurrentPages().length<10){
					uni.navigateTo({
						url: `/page_public/surePay?type=${type}&yinfuMoney=${item.money - item.preferential}&time=${this.Utils.DateFormateArr(item.createTime)}&orderId=${item.orderId}`
					})
				} else{	
					uni.redirectTo({
						url: `/page_public/surePay?type=${type}&yinfuMoney=${item.money - item.preferential}&time=${this.Utils.DateFormateArr(item.createTime)}&orderId=${item.orderId}`
					})
				}
				
			},
			//关闭订单
			closeOrder(item) {
				this.modalShow = true
				this.modalInfo.content = '是否关闭当前订单？？？'
				this.orderId = item?.orderId || ''
				this.modalType = 1 //关闭订单操作

			},
			//确认订单
			sureOrder(item) {
				this.modalShow = true
				this.modalInfo.content = '是否确认当前订单已修改的信息准确无误？？？'
				this.orderId = item?.orderId || ''
				this.modalType = 2 //确认订单操作
			},
			//确认收货
			sureShouhuo(item) {
				this.modalShow = true
				this.modalInfo.content = '是否确定已经签收该订单？？？'
				this.orderId = item?.orderId || ''
				this.modalType = 3 //确认收货操作

			},
			//删除订单
			delOrder(item) {
				this.modalShow = true
				this.modalInfo.content = '是否确定删除当前订单？？？'
				this.orderId = item?.orderId || ''
				this.modalType = 4 //删除订单
			},
			//模态确定
			async modalConfirm() {
				if (this.modalType == 1) { //关闭订单操作
					// 标记[1.订单确认  2.确认收货  3.审核通过  4.作废  5.订单修改  6.关闭]
					let res = await updateMallOrderStatus({
						tag: 6,
						orderId: this.orderId
					})
					if (res.code == 2000) {
						this.Utils.toast(`关闭成功`)
						this.modalShow = false

					} else {
						this.Utils.toast(`${res.msg}`)
					}
				}
				if (this.modalType == 2) { //确认订单操作
					//标记[1.订单确认  2.确认收货  3.审核通过  4.作废  5.订单修改  6.关闭]
					let res = await updateMallOrderStatus({
						tag: 1,
						orderId: this.orderId
					})
					if (res.code == 2000) {
						this.Utils.toast(`确认成功`)
						this.modalShow = false

					} else {
						this.Utils.toast(`${res.msg}`)
					}
				}
				if (this.modalType == 3) { //确认收货操作
					//标记[1.订单确认  2.确认收货  3.审核通过  4.作废  5.订单修改  6.关闭]
					let res = await updateMallOrderStatus({
						tag: 2,
						orderId: this.orderId
					})
					if (res.code == 2000) {
						this.Utils.toast(`确认成功`)
						this.modalShow = false

					} else {
						this.Utils.toast(`${res.msg}`)
					}
				}
				if (this.modalType == 4) { //删除订单操作
					let res = await deleteMallOrderByOrderId({
						orderId: this.orderId
					})
					if (res.code == 2000) {
						this.Utils.toast(`删除成功`)
						this.modalShow = false
						// this.navToBack();
					} else {
						this.Utils.toast(`${res.msg}`)
					}
				}
				this.navToBack();
			},
			// 点击复制订单号
			copyText(res) {
				uni.setClipboardData({
					data: res,
					success: () => {
						this.Utils.toast('复制成功')
					}
				})
			},

			//返回
			navToBack() {
				if (this.routeType == 'allOrder' || this.routeType == '') {
					uni.redirectTo({
						url: `/page_public/allOrder?statusInfo=${JSON.stringify({status:0,payStatus:0})}`
					})
					// 返回按钮 判断当前页面栈是否大于10
									// if(getCurrentPages().length<10){
									// 	uni.navigateBack()
										
									// } else{
									// 	uni.redirectTo({
									// 		url: `/page_public/allOrder?statusInfo=${JSON.stringify({status:0,payStatus:0})}`
									// 	})
									// }
				}
				if (this.routeType == 'tbcOrder') {
					// uni.navigateTo({
					// 	url: '/page_public/tbcOrder'
					// })
						// 页面跳转 判断当前页面栈是否大于10
									if(getCurrentPages().length<10){
										uni.navigateTo({
											url:`/page_public/tbcOrder`
										})
									} else{
											
										uni.redirectTo({
											url:`/page_public/tbcOrder`
										})
									}
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	/deep/.u-textarea {
		padding: 0 !important;
	}
	/deep/.u-modal__button-group__wrapper--confirm.u-modal__button-group__wrapper--confirm  {
		background-color: #ec4141;
		
		.u-modal__button-group__wrapper__text {
			color: #FFF !important;
		}
	}
	.mian_orferDetails {
		width: 100%;
		box-sizing: border-box;
		padding-bottom: 120rpx;

		.mian_orfer_top {
			width: 100%;
			border-radius: $border_radius_10;
			background-color: #FFF;
			box-sizing: border-box;

			.mian_orfer_top_t {
				width: 100%;
				height: 180rpx;
				border-bottom: 1px solid #f3f3f3;
				display: flex;

				.mian_orfer_top_t_l {
					width: 228rpx;
					height: 100%;

					image {
						width: 100%;
						height: 100%;
					}
				}

				.mian_orfer_top_t_r {
					flex: auto;
					display: flex;
					flex-direction: column;
					justify-content: space-evenly;

					.mian_orfer_top_t_r_t {
						font-size: $font_size_18;
						color: $text_color_333;
						font-weight: bold;
					}

					.mian_orfer_top_t_r_b {
						font-size: $font_size_12;
						color: $text_color_808080;
					}
				}
			}

			.mian_orfer_top_b {
				width: 100%;

				.mian_orfer_top_b_t {
					text {
						font-size: $font_size_14;
						font-weight: bold;
					}

					.name {
						color: $text_color_333;
					}

					.phone {
						color: $text_color_808080;
					}
				}

				.mian_orfer_top_b_b {
					font-size: $font_size_12;
					color: $text_color_333;
				}
			}
		}

		.mian_allOrder_list_item {
			background-color: #FFF;
			width: 100%;
			border-radius: $border_radius_10;

			.list_item_top {
				height: 88rpx;
				border-bottom: 1px solid #f3f3f3;
				display: flex;
				align-items: center;
				justify-content: space-between;
				color: $text_color_333;

				.list_item_top_left {
					font-size: 32rpx;
					color: $text_color_333;
					font-weight: bold;
				}

				.list_item_top_right {
					font-size: $font_size_14;
				}
			}

			.list_item_conter {
				border-bottom: 1px solid #f3f3f3;

				.list_item_conter_top,
				.list_item_conter_bom {
					display: flex;
					

					.list_item_conter_top_img {
						position: relative;
						border-radius: $border_radius_4;
						width: 160rpx;
						height: 160rpx;

						.zenpin {
							position: absolute;
							left: 0;
							top: 0;
							z-index: 999;
							width: 80rpx;
							height: 32rpx;
						}

						image {
							width: 100%;
							height: 100%;
							border-radius: 12rpx;
						}
					}

					.list_item_conter_top_text {
						flex: 1;
                        width: 400rpx;
						.list_item_conter_top_text_top {
							font-size: $font_size_14;
							color: $text_color_333;
						}

						.list_item_conter_top_text_bom {
							.biaoqian {
								font-size: $font_size_12;
								float: right;
								    color: #ec4141;
								    padding: 4rpx;
								    background-color: #ffe3e3;
								    width: 159rpx;
								    max-width: 300rpx;
								    border-radius: 8rpx;
								    text-align: center;
								    float: right;
							}
							.list_item_conter_top_text_bom_item {
								font-size: $font_size_12;
								display: flex;
								justify-content: space-between;

								.list_item_conter_top_text_bom_item_l {
									color: $text_color_808080;
								}

								.list_item_conter_top_text_bom_item_r {
									color: $text_color_333;
									font-size: $font_size_14;
                                  
								}

								
							}
						}
					}

					.list_item_conter_bom {
						margin-left: 100rpx;
					}
				}

			}
		}

		.mian_confirmOrder_detail {
			background-color: #FFF;
			width: 100%;
			border-radius: $border_radius_10;
			box-sizing: border-box;

			.mian_confirmOrder_detail_t {
				height: 88rpx;
				border-bottom: 1px solid #f3f3f3;
				display: flex;
				align-items: center;
				justify-content: space-between;

				.mian_confirmOrder_detail_t_l {
					color: $text_color_333;
					font-size: 32rpx;
					font-weight: bold;
				}
			}

			.mian_confirmOrder_detail_b {
				.mian_confirmOrder_detail_b_r {
					height: 88rpx;
					border-bottom: 1px solid #f3f3f3;
					display: flex;
					align-items: center;
					justify-content: space-between;
					font-size: $font_size_14;

					.mian_confirmOrder_detail_b_r_l {
						width: 150rpx;
						color: $text_color_808080;
					}

					.mian_confirmOrder_detail_b_r_r {
						flex: 1;
						color: $text_color_333;
					}
				}

				.mian_confirmOrder_detail_beizhu {
					height: 200rpx;
					border-bottom: 1px solid #f3f3f3;
					display: flex;
					font-size: $font_size_14;
					color: $text_color_808080;

					.mian_confirmOrder_detail_beizhu_l {
						margin-top: 20rpx;
					}

					/deep/.uni-textarea-placeholder {
						font-size: $font_size_14;
					}

					/deep/.uni-textarea-textarea {
						font-size: $font_size_14;
						background-color: #FFF;
					}
				}
			}
		}

	}

	.mian_orderDetailsBom {
		width: 100%;
		height: 100rpx;
		box-sizing: border-box;
		position: fixed;
		left: 0;
		bottom: 0;
		background-color: #FFF;
		display: flex;
		align-items: center;
		justify-content: flex-end;

		.list_item_btn_item {
			font-size: $font_size_14;
			color: $text_color_333;
			border: 1px solid rgba(230, 230, 230, 1);
			width: 160rpx;
			height: 60rpx;
			line-height: 60rpx;
			text-align: center;
			border-radius: $border_radius_4;

		}

		.list_item_btn_item_active {
			color: $text_color_ec4141;
			border: 1px solid $text_color_ec4141;
		}
	}
</style>